From: Brion Vibber Date: Tue, 24 Aug 2004 03:10:51 +0000 (+0000) Subject: Patch by Ivan Krstic, slightly modified, for the session handler wrong setting problem. X-Git-Tag: 1.5.0alpha1~2242 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=114dcf5e5e347d7def989df2c502c5668df63aed;p=lhc%2Fweb%2Fwiklou.git Patch by Ivan Krstic, slightly modified, for the session handler wrong setting problem. Bug 179: Detect when session.save_handler set incorrectly http://bugzilla.wikipedia.org/show_bug.cgi?id=179 --- diff --git a/includes/User.php b/includes/User.php index 578a7ee293..294923d67e 100644 --- a/includes/User.php +++ b/includes/User.php @@ -155,6 +155,10 @@ class User { global $wgSessionsInMemcached, $wgCookiePath, $wgCookieDomain; if( $wgSessionsInMemcached ) { require_once( 'MemcachedSessions.php' ); + } elseif( 'files' != ini_get( 'session.save_handler' ) ) { + # If it's left on 'user' or another setting from another + # application, it will end up failing. Try to recover. + ini_set ( 'session.save_handler', 'files' ); } session_set_cookie_params( 0, $wgCookiePath, $wgCookieDomain ); session_cache_limiter( 'private, must-revalidate' );